import request from '@/config/axios'

// 团长缴费记录 VO
export interface GuaranteeRecordVO {
  id: number // 主键
  userId: number // 用户id
  guaranteePrice: number // 保证金金额
  status: number // 状态 0 未支付 1 已支付  2已退
  tradeNo: string // 交易号
  tradeTime: Date // 交易时间
  teamTypeId: number // 团长缴费id
  deadline: Date // 截止时间
}

// 团长缴费记录 API
export const GuaranteeRecordApi = {
  // 查询团长缴费记录分页
  getGuaranteeRecordPage: async (params: any) => {
    return await request.get({ url: `/wine/guarantee-record/page`, params })
  },

  // 查询团长缴费记录详情
  getGuaranteeRecord: async (id: number) => {
    return await request.get({ url: `/wine/guarantee-record/get?id=` + id })
  },

  // 新增团长缴费记录
  createGuaranteeRecord: async (data: GuaranteeRecordVO) => {
    return await request.post({ url: `/wine/guarantee-record/create`, data })
  },

  // 修改团长缴费记录
  updateGuaranteeRecord: async (data: GuaranteeRecordVO) => {
    return await request.put({ url: `/wine/guarantee-record/update`, data })
  },

  // 删除团长缴费记录
  deleteGuaranteeRecord: async (id: number) => {
    return await request.delete({ url: `/wine/guarantee-record/delete?id=` + id })
  },

  // 导出团长缴费记录 Excel
  exportGuaranteeRecord: async (params) => {
    return await request.download({ url: `/wine/guarantee-record/export-excel`, params })
  }
}
